import request from '@/utils/request'

// 根据id查询记录
export const getRouterById = (id) =>
  request({
    url: `/sys/router/${id}`,
    method: 'get'
  })

// 分页查询
export const listRouterPage = (search) =>
  request({
    url: '/sys/router/list',
    method: 'post',
    data: search
  })

// 查询所有记录
export const listRouterAll = (search) =>
  request({
    url: '/sys/router/listAll',
    method: 'post',
    data: search
  })

// 获取树形结构数据
export const treeRouter = (search) =>
  request({
    url: '/sys/router/tree',
    method: 'post',
    data: search
  })

// 保存/更新记录
export const saveRouter = (router) =>
  request({
    url: '/sys/router/save',
    method: 'post',
    data: router
  })

// 删除记录
export const deleteRouter = (router) =>
  request({
    url: '/sys/router/delete',
    method: 'post',
    data: router
  })

// 批量保存/更新记录
export const bulkInsertRouter = (routers) =>
  request({
    url: '/sys/router/bulkInsert',
    method: 'post',
    data: routers
  })

// 批量更新记录
export const bulkUpdateRouter = (routers) =>
  request({
    url: '/sys/router/bulkUpdate',
    method: 'post',
    data: routers
  })

// 批量删除记录
export const bulkDeleteRouter = (routers) =>
  request({
    url: '/sys/router/bulkDelete',
    method: 'post',
    data: routers
  }) 